<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<head>
<title>首页</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<link rel="stylesheet" href="<?php echo base_url() . 'style/index' ?>/css/index.css" />
<script type="application/javascript" src="<?php echo base_url() . 'style/index' ?>/js/jquery-1.7.1.min.js"></script>
<script type="application/javascript" >
        function changeRecommendArticle (cid) {
            $.ajax({
                type:'post',
                data:{'cid':cid},
                url : "<?php echo site_url('index/home/getRecommendArticle/ajax') ?>",
                success : function (data){
                    $("#recommend").html(data);
                }
            });
        }
        function ajax_page (url) {
            $.ajax({
                url : url,
                type: 'post',
                success : function (data) {
                    $("#recommend").html(data);
                }
            });
        }
</script>
<?php $this->load->view('public/head.php'); ?>
    	<div id="article">
    		<div class="l_box f_l">
    			<div id="slide-holder">
	    			<div class="banner">
	    				<div id="slide_runner">
	    					<a href=""><img id="slide-img-1" src="<?php echo base_url() . 'style/index' ?>/images/a1.jpg" alt="" /></a>
	    					<a href=""><img id="slide-img-2" src="<?php echo base_url() . 'style/index' ?>/images/a2.jpg" alt="" /></a>
	    					<a href=""><img id="slide-img-3" src="<?php echo base_url() . 'style/index' ?>/images/a3.jpg" alt="" /></a>
	    					<a href=""><img id="slide-img-4" src="<?php echo base_url() . 'style/index' ?>/images/a4.jpg" alt="" /></a>
		    				<div id="slide-controls">
						            <p id="slide-client" class="text"><strong></strong><span></span></p>
						            <p id="slide-desc" class="text"></p>
						            <p id="slide-nav"></p>
					          </div>
	    				</div>
	    			</div>
    			</div>
    			<div class="topnew">
    				<h2>
					文章推荐
					<span>
                        <?php foreach($cate as $k => $v): ?>
						<a href="javascript:void(0);" onclick="changeRecommendArticle(<?php echo $v['cid'] ?>);"><?php echo $v['cname'] ?></a>
                        <?php endforeach; ?>
					</span>
    				</h2>

                    <?php $this->load->view('index/recommend.php'); ?>

    			</div>

    		</div>


    		<div class="r_box f_r">
    			<div class="tit01">
    				<h3>关注我</h3>
    				<div class="gzwm">
    					<ul>
    						<li><a class="xlwb" href="">新浪微博</a></li>
    						<li><a class="txwb" href="">腾讯微博</a></li>
    						<li><a class="rss" href="">RSS订阅</a></li>
    						<li><a class="email" href="">邮箱</a></li>
    					</ul>
    				</div>
    			</div>
    			<div class="ad300X100">
    				<img src="<?php echo base_url() . 'style/index' ?>/images/ad300x100.jpg" alt="" />
    			</div>

            <!--切换卡 moreSelect 开始 -->
			<div class="moreSelect" id="lp_right_select"> 
			      <div class="ms-top">
			        <ul class="hd" id="tab">
			          <li class="cur"><a href="/">点击排行</a></li>
			          <li><a href="/">最新文章</a></li>
			          <li><a href="/">热门文章</a></li>
			        </ul>
			      </div>
			      <div class="ms-main" id="ms-main">
			        <div style="display: block;" class="bd bd-news" >
			          <ul>
                          <?php foreach($click as $k => $v): ?>
			                <li><a href="/" target="_blank"><?php echo $v['title'] ?></a></li>
                          <?php endforeach; ?>
			          </ul>
			        </div>
			        <div  class="bd bd-news">
			          <ul>
                          <?php foreach($new as $k => $v): ?>
                              <li><a href="/" target="_blank"><?php echo $v['title'] ?></a></li>
                          <?php endforeach; ?>
			          </ul>
			        </div>
			        <div class="bd bd-news">
			          <ul>
                          <?php foreach($hot as $k => $v): ?>
                              <li><a href="/" target="_blank"><?php echo $v['title'] ?></a></li>
                          <?php endforeach; ?>
			          </ul>
			        </div>
			      </div>
			</div>
			<!--切换卡 moreSelect end -->
			
			<!--标签云开始 -->
			<?php $this->load->view('public/cloud.php'); ?>
			<!--标签云结束 -->
			
			<!-- 图文推荐开始 -->
			<div class="tuwen">
				<h3>图文推荐</h3>
				<ul>
                    <?php foreach($graphic as $k => $v): ?>
					<li>
						<a href="/"><img src="<?php echo base_url() . $v['thumb'] ?>"><b><?php echo $v['title'] ?></b></a>
					  	<p><span class="tulanmu"><a href="/"><?php echo $v['cname'] ?></a></span><span class="tutime"><?php echo date('Y-m-d',$v['time']) ?></span></p>
					</li>
                    <?php endforeach; ?>
				</ul>
			</div>
			<!-- 图文推荐结束-->

    		</div>
    	</div>
        <?php $this->load->view('public/foot.php'); ?>
    </body>
    
    <script type="text/javascript">

	<!-- banner图片轮播 -->
	slider.data= [
	{
	    "id":"slide-img-1", // 与slide-runner中的img标签id对应
	    "client":"标题1",
	    "desc":"这里修改描述 这里修改描述 这里修改描述" //这里修改描述
	},
	{
	    "id":"slide-img-2",
	    "client":"标题2",
	    "desc":"add your description here"
	},
	{
	    "id":"slide-img-3",
	    "client":"标题3",
	    "desc":"add your description here"
	},
	{
	    "id":"slide-img-4",
	    "client":"标题4",
	    "desc":"add your description here"
	}
	];

	<!-- 选项卡切换 -->
	window.onload = function ()
	{
		var oLi = document.getElementById("tab").getElementsByTagName("li");
		var oUl = document.getElementById("ms-main").getElementsByTagName("div");
		
		for(var i = 0; i < oLi.length; i++)
		{
			oLi[i].index = i;
			oLi[i].onmouseover = function ()
			{
				for(var n = 0; n < oLi.length; n++) oLi[n].className="";
				this.className = "cur";
				for(var n = 0; n < oUl.length; n++) oUl[n].style.display = "none";
				oUl[this.index].style.display = "block"
			}	
		}
	}
    </script>
</html>